﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Userpanel-gegevens.aspx.cs" Inherits="WebshopPizzaRio.Userpanel_gegevens" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 534px;
        }
        .style3
        {
            width: 187px;
        }
        .style8
        {
            width: 7px;
        }
        .style10
        {
            width: 116px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:PizzaRioConnectionString %>" 
        SelectCommand="SELECT [UserId], [Voornaam], [Achternaam], [Adres], [Woonplaats], [Telefoon] FROM [Membership_NaamAdresWoonplaats] WHERE ([UserId] = @UserId)"
        
    UpdateCommand="UPDATE [Membership_NaamAdresWoonplaats] SET [Voornaam] = @Voornaam, [Achternaam] = @Achternaam, [Adres] = @Adres, [Woonplaats] = @Woonplaats, [Telefoon] = @Telefoon WHERE [UserId] = @UserId" 
    DeleteCommand="DELETE FROM [Membership_NaamAdresWoonplaats] WHERE [UserId] = @UserId" 
    InsertCommand="INSERT INTO [Membership_NaamAdresWoonplaats] ([UserId], [Voornaam], [Achternaam], [Adres], [Woonplaats], [Telefoon]) VALUES (@UserId, @Voornaam, @Achternaam, @Adres, @Woonplaats, @Telefoon)">
        <DeleteParameters>
            <asp:Parameter Name="UserId" Type="Object" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="UserId" Type="Object" />
            <asp:Parameter Name="Voornaam" Type="String" />
            <asp:Parameter Name="Achternaam" Type="String" />
            <asp:Parameter Name="Adres" Type="String" />
            <asp:Parameter Name="Woonplaats" Type="String" />
            <asp:Parameter Name="Telefoon" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:SessionParameter Name="UserId" SessionField="SessionUserId" 
                Type="Object" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Voornaam" Type="String" />
            <asp:Parameter Name="Achternaam" Type="String" />
            <asp:Parameter Name="Adres" Type="String" />
            <asp:Parameter Name="Woonplaats" Type="String" />
            <asp:Parameter Name="Telefoon" Type="String" />
            <asp:Parameter Name="UserId" Type="Object" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <p>
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="UserId" 
        DataSourceID="SqlDataSource1" 
    onpageindexchanging="FormView1_PageIndexChanging" Width="479px">
        <EditItemTemplate>
            <table class="style1">
                <%--<tr>
                    <td>
                        UserId</td>
                    <td>
                        :</td>
                    <td>
                        <asp:Label ID="UserIdLabel1" runat="server" Text='<%# Eval("UserId") %>' />
                    </td>
                </tr>--%>
                <tr>
                    <td>
                        Voornaam</td>
                    <td>
                        :</td>
                    <td>
                        <asp:TextBox ID="VoornaamTextBox" runat="server" 
                            Text='<%# Bind("Voornaam") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Achternaam</td>
                    <td>
                        :</td>
                    <td>
                        <asp:TextBox ID="AchternaamTextBox" runat="server" 
                            Text='<%# Bind("Achternaam") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Adres</td>
                    <td>
                        :</td>
                    <td>
                        <asp:TextBox ID="AdresTextBox" runat="server" Text='<%# Bind("Adres") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Woonplaats</td>
                    <td>
                        :</td>
                    <td>
                        <asp:TextBox ID="WoonplaatsTextBox" runat="server" 
                            Text='<%# Bind("Woonplaats") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Telefoon</td>
                    <td>
                        :</td>
                    <td>
                        <asp:TextBox ID="TelefoonTextBox" runat="server" 
                            Text='<%# Bind("Telefoon") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="Annuleren" />
                    </td>
                    <td>
                        &nbsp;</td>
                    <td>
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Opslaan" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
        </EditItemTemplate>
        <InsertItemTemplate>
            <%--UserId:
            <asp:TextBox ID="UserIdTextBox" runat="server" Text='<%# Bind("UserId") %>' />
            <br />--%>
            Voornaam:
            <asp:TextBox ID="VoornaamTextBox0" runat="server" 
                Text='<%# Bind("Voornaam") %>' />
            <br />
            Achternaam:
            <asp:TextBox ID="AchternaamTextBox0" runat="server" 
                Text='<%# Bind("Achternaam") %>' />
            <br />
            Adres:
            <asp:TextBox ID="AdresTextBox0" runat="server" 
                Text='<%# Bind("Adres") %>' />
            <br />
            Woonplaats:
            <asp:TextBox ID="WoonplaatsTextBox0" runat="server" 
                Text='<%# Bind("Woonplaats") %>' />
            <br />
            Telefoon:
            <asp:TextBox ID="TelefoonTextBox0" runat="server" 
                Text='<%# Bind("Telefoon") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            <table class="style1">
<%--                <tr>
                    <td class="style10">
                        UserId</td>
                    <td class="style8">
                        :</td>
                    <td class="style3">
                        <asp:Label ID="UserIdLabel" runat="server" Text='<%# Eval("UserId") %>' />
                    </td>
                </tr>--%>
                <tr>
                    <td class="style10">
                        Voornaam</td>
                    <td class="style8">
                        :</td>
                    <td class="style3">
                        <asp:Label ID="VoornaamLabel" runat="server" Text='<%# Bind("Voornaam") %>' />
                    </td>
                </tr>
                <tr>
                    <td class="style10">
                        Achternaam</td>
                    <td class="style8">
                        :</td>
                    <td class="style3">
                        <asp:Label ID="AchternaamLabel" runat="server" 
                            Text='<%# Bind("Achternaam") %>' />
                    </td>
                </tr>
                <tr>
                    <td class="style10">
                        Adres</td>
                    <td class="style8">
                        :</td>
                    <td class="style3">
                        <asp:Label ID="AdresLabel" runat="server" Text='<%# Bind("Adres") %>' />
                    </td>
                </tr>
                <tr>
                    <td class="style10">
                        Woonplaats</td>
                    <td class="style8">
                        :</td>
                    <td class="style3">
                        <asp:Label ID="WoonplaatsLabel" runat="server" 
                            Text='<%# Bind("Woonplaats") %>' />
                    </td>
                </tr>
                <tr>
                    <td class="style10">
                        Telefoon</td>
                    <td class="style8">
                        :</td>
                    <td class="style3">
                        <asp:Label ID="TelefoonLabel" runat="server" Text='<%# Bind("Telefoon") %>' />
                    </td>
                </tr>
                <tr>
                    <td class="style10">
                        &nbsp;</td>
                    <td class="style8">
                        &nbsp;</td>
                    <td class="style3">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style10">
                        <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="Gegevens wijzigen" />
                    </td>
                    <td class="style8">
                    </td>
                    <td class="style3">
                        &nbsp;</td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:FormView>
    </p>
</asp:Content>
